package com.guizi.halftimesroom.app;

import android.app.Application;
import android.graphics.Bitmap;

import com.squareup.picasso.LruCache;
import com.squareup.picasso.OkHttpDownloader;
import com.squareup.picasso.Picasso;

/**
 * Created by Alan on 2016/7/15.
 */
public class IApp extends Application{
    @Override
    public void onCreate() {
        super.onCreate();
        initPicasso();
    }

    private void initPicasso() {
        Picasso picasso = new Picasso.Builder(this)
                .defaultBitmapConfig(Bitmap.Config.RGB_565)
                .memoryCache(new LruCache(50 << 20))
                .downloader(new OkHttpDownloader(this))
                .build();
        Picasso.setSingletonInstance(picasso);
    }
}
